open(FileIn,"<dict.txt");
while($Line=<FileIn>){
	chomp($Line);
	if ($Line=~/^\#(.*)$/){$Word=$1;}
	if ($Line=~/^Trans:(.*)$/){$mapDict{$Word}=$1;}
}
close(FileIn);

while(1){
	print "Pls input sentence(press q to exit!):\n";
	$Word=<STDIN>;
	chomp($Word);
	exit if ( $Word eq "q" );
	print SearchDict($Word)."\n";
}


sub SearchDict{
	my($Word)=@_;
	my $Trans;
	if ( defined $mapDict{$Word}){
		$Trans=$mapDict{$Word};
		$Trans=~s/\@/\n/g;
	}else{
		$Trans="Not Found!";
	}
	return $Trans;
};


